<template>
  <view class="">
  	<image src="https://mp-cc85421a-533b-4b68-b797-f0a3eba335d0.cdn.bspapp.com/Swipers2/1.jpg" mode="widthFix"></image>
  </view>
</template>

<script>
export default {
  onLoad() {
    // 创建Promise数组，用于加载加载页面和首页
    const promises = [
      this.loadComponent('/pages/loading/loading'),
      this.loadComponent('/pages/index/index')
    ];

    // 使用Promise.all同时加载组件
    Promise.all(promises).then(() => {
      uni.switchTab({
        url: '/pages/index/index' // 跳转到首页
      });
    });
  },
  methods: {
    loadComponent(url) {
      return new Promise((resolve, reject) => {
        uni.request({
          url,
          success() {
            resolve();
          },
          fail(error) {
            reject(error);
          }
        });
      });
    }
  }
};
</script>

<style>
/* 这里是启动页的样式 */
</style>
